﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RegisterEnterprise.aspx.cs"
    Inherits="NJL.Web.RegisterEnterprise" %>

<%@ Register Src="Controls/WUCHeader1.ascx" TagName="WUCHeader1" TagPrefix="uc1" %>
<%@ Register Src="Controls/WUCFooter1.ascx" TagName="WUCFooter1" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>申请开通商铺</title>
    <link href="Styles/manage.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        function checkCode() {
            //判断企业是否选择企业类型
            var selectCompanyType = document.getElementById("<%=rblType.ClientID %>").getElementsByTagName("input").length;
            var selectedCompanyType = false;
            for (var i = 0; i < selectCompanyType; i++) {
                if (document.getElementById("rblType_" + i).checked == true) {
                    selectedCompanyType = true;
                    break;
                }
            }
            if (!selectedCompanyType) {
                alert("请选择商户类型");
                return false;
            }
            var ddlArea = document.getElementById("<%=ddlArea.ClientID %>").value;
            if (ddlArea == "0") {
                alert("请选择地区");
                return false;
            }
            //判断企业名称是否输入
            var txtName = document.getElementById("<%=txtName.ClientID %>").value;
            txtName = $.trim(txtName);
            if (txtName == "") {
                alert("请输入企业名称");
                return false;
            }
            var txtAddress = document.getElementById("<%=txtAddress.ClientID %>").value;
            if ($.trim(txtAddress).length == 0) {
                alert("请输入所在地");
                return false;
            }
            var fileUpload1 = document.getElementById("<%=FileUpload1.ClientID %>").value;
            if ($.trim(fileUpload1).length == 0) {
                alert("请上传营业执照副本扫描件");
                return false;
            }
            var file1Ok = false;
            var fileExtend1 = fileUpload1.substring(fileUpload1.lastIndexOf('.')).toLowerCase();
            var allowedExtensions = new Array(".jpg", ".gif", ".jpeg");
            for (var i in allowedExtensions) {
                if (allowedExtensions[i] == fileExtend1) {
                    file1Ok = true;
                }
            }
            if (!file1Ok) {
                alert("只能上传.jpg、.gif格式的图片文件哦");
                return false;
            }
            var fileUpload2 = document.getElementById("<%=FileUpload2.ClientID %>").value;
            if ($.trim(fileUpload2).length == 0) {
                alert("请上传税务登记证扫描件");
                return false;
            }
            var file2Ok = false;
            var fileExtend2 = fileUpload2.substring(fileUpload2.lastIndexOf('.')).toLowerCase();
            var allowedExtensions = new Array(".jpg", ".gif", ".jpeg");
            for (var i in allowedExtensions) {
                if (allowedExtensions[i] == fileExtend2) {
                    file2Ok = true;
                }
            }
            if (!file2Ok) {
                alert("只能上传.jpg、.gif格式的图片文件哦");
                return false;
            }
            var txtLinkman = document.getElementById("<%=txtLinkman.ClientID %>").value;
            if ($.trim(txtLinkman).length == 0) {
                alert("请输入联系人");
                return false;
            }
            var txtCellPhone = document.getElementById("<%=txtCellPhone.ClientID %>").value;
            if ($.trim(txtCellPhone).length == 0) {
                alert("请输入手机号");
                return false;
            }
            var txtTel = document.getElementById("<%=txtTel.ClientID %>").value;
            if ($.trim(txtTel).length == 0) {
                alert("请输入联系电话");
                return false;
            }
            return true;
        }
        $(document).ready(function () {
            var tdCss = document.getElementById("<%=rblType.ClientID %>").getElementsByTagName("td");
            for (var i = 0; i < tdCss.length; i++) {
                if (i < 3) {
                    tdCss[i].className = "orangebor";
                }
                else {
                    tdCss[i].className = "greenbor";
                }
            }

        }
        );  
    </script>
    <link rel="stylesheet" type="text/css" href="Styles/base1.css" />
</head>
<body>
    <form id="form1" runat="server">
    <uc1:WUCHeader1 ID="WUCHeader11" runat="server" />
    <div class="cleanFlex managecont">
        <div class="registinfo">
            <p>
                回归田园生活，感受乡村气息！</p>
        </div>
        <!--商户注册-->
        <div class="registtype">
            <!--选择类型-->
            <div class="busdate">
                <div class="datatitle">
                    <span>注：带<strong>*</strong>号为必填</span>
                    <h2>
                        <strong>填写以下资料，即可轻松完成注册。</strong></h2>
                </div>
                <div class="cont">
                    <div class="baseinfo">
                        <div class="basetype">
                            <h3>
                                选择商户类型<strong style="color: #ff0000">*</strong>
                            </h3>
                            <asp:RadioButtonList ID="rblType" runat="server" CellPadding="0" CellSpacing="0"
                                RepeatDirection="Horizontal" CssClass="tab" Width="100%">
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div>
                        <div class="m_top_20">
                        </div>
                        <table cellpadding="0" cellspacing="0" class="tab" width="100%">
                            <tr>
                                <td width="35%" class="left">
                                    地区
                                </td>
                                <td colspan="3">
                                    &nbsp;
                                    <asp:DropDownList ID="ddlArea" runat="server">
                                    </asp:DropDownList>
                                    <strong style="color: #ff0000">*</strong>
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    企业名称
                                </td>
                                <td colspan="3">
                                    <asp:TextBox ID="txtName" runat="server" MaxLength="25" class="input" Style="width: 555px;"></asp:TextBox><strong
                                        style="color: #ff0000">*</strong>
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    所在地
                                </td>
                                <td colspan="3">
                                    <asp:TextBox ID="txtAddress" runat="server" MaxLength="100" class="input" Style="width: 555px;"></asp:TextBox><strong
                                        style="color: #ff0000">*</strong>
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    营业执照副本扫描件
                                </td>
                                <td colspan="3">
                                    <asp:FileUpload ID="FileUpload1" runat="server" />
                           
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    税务登记证扫描件
                                </td>
                                <td colspan="3">
                                    <asp:FileUpload ID="FileUpload2" runat="server" />
 
                                </td>
                            </tr>
                            <tr style="display: none">
                                <td class="left">
                                    商户出具的证明该联系人获得商户授权的证明
                                </td>
                                <td colspan="3">
                                    <asp:FileUpload ID="FileUpload3" runat="server" />
                                    <asp:Image ID="Image3" runat="server" Height="50px" Width="200px" />
                                </td>
                            </tr>
                            <tr style="display: none">
                                <td class="left">
                                    餐饮类商户需提供餐饮服务许可证扫描件
                                </td>
                                <td colspan="3">
                                    <asp:FileUpload ID="FileUpload4" runat="server" />
                                    <asp:Image ID="Image4" runat="server" Height="50px" Width="200px" />
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    联系人
                                </td>
                                <td colspan="3">
                                    <asp:TextBox ID="txtLinkman" runat="server" MaxLength="25" class="input" Style="width: 175px;"></asp:TextBox><strong
                                        style="color: #ff0000">*</strong>
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    手机
                                </td>
                                <td width="31%">
                                    <asp:TextBox ID="txtCellPhone" runat="server" MaxLength="11" class="input" Style="width: 175px;"></asp:TextBox><strong
                                        style="color: #ff0000">*</strong>
                                </td>
                                <td width="12%" class="left">
                                    联系电话
                                </td>
                                <td width="46%">
                                    <asp:TextBox ID="txtTel" runat="server" MaxLength="15" class="input" Style="width: 175px;"></asp:TextBox><strong
                                        style="color: #ff0000">*</strong>
                                </td>
                            </tr>
                            <tr>
                                <td class="left">
                                    MSN
                                </td>
                                <td>
                                    <asp:TextBox ID="txtMsn" runat="server" MaxLength="100" class="input" Style="width: 175px;"></asp:TextBox>
                                </td>
                                <td class="left">
                                    QQ
                                </td>
                                <td>
                                    <asp:TextBox ID="txtQQ" runat="server" MaxLength="10" class="input" Style="width: 175px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td colspan="4" class="bottom">
                                    <asp:Button ID="btnSubmit" runat="server" OnClick="btnSubmit_Click" OnClientClick="return checkCode()"
                                        class="registBtn" />
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <uc2:WUCFooter1 ID="WUCFooter11" runat="server" />
    </form>
</body>
</html>
